<?php

require_once ('BaseAjaxModule.php');

class CategoriesModule extends BaseAjaxModule {
	
	public function loadProductsTask()	{
		$cat = new Model_Category();
		$cat->id = $this->getParam('id');
		$this->view->result = $cat->loadProducts();
	}
	
	public function loadCategoryDetailTask()	{
		$pro = new Model_Category();
		$pro->id = $this->getParam('id');
		$pro->connect();
		$this->view->result = $pro->getInfo();
	}
	
	public function loadAllCategoriesTask()	{
		$this->view->result = Model_Category::loadAllCategories();
	}
	
	public function loadLeafCategoriesTask()	{
		$this->view->result = Model_Category::loadLeafCategories();
	}
}

?>